<html>
<head>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

gc = window.gc || function()
{
    if (window.GCController)
        return GCController.collect();

    for (var i = 0; i < 10000; ++i)
        var s = new String("AAAA");
}

window.onload = function()
{
    element = document.body.appendChild(document.createElement("a"));

    element.setAttributeNS("namespace", "id", "foo");
    element.setAttribute("id", "bar");
    
    document.body.removeChild(element);
    element = null;
    gc();
    
    setTimeout(finishTest, 0);
}

finishTest = function()
{
    document.getElementById("bar");

    if (window.testRunner)
        testRunner.notifyDone();
}
</script>
</head>
<body>PASS</body>
</html>
